﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using aop_cache_Entity;
using aop_cache_Data;
using Project.Unity;
using Infrastructure;
using aop_cache_WebService;
using System.IO;
using aop_cache.Filters;
namespace aop_cache.Controllers
{
    // [Filters.Layout("_LayoutRed")]
    public class HomeController : Controller
    {

        //  IClassroom_InfoRepository _iClassroom_InfoRepository = ServiceLocator.Instance.GetService<IClassroom_InfoRepository>();
        //   IClassroom_InfoRepository _iClassroom_InfoRepository = new Classroom_InfoRepository();
        // IService1 iservice1 = ServiceLocator.Instance.GetService<IService1>(); //走ioc容器，可以设定缓存
        //
        public ActionResult Index(string keyword)
        {
            ViewBag.Title = "大占占，主页";
            ViewBag.Meta_Keywords = "网站Meta关键字";
            ViewBag.Meta_Description = "网站Meta说明文字";
            //  通过WCF获取远程数据,不走缓存, 走config中的<system.serviceModel>
            using (ServiceProxy<IService1> proxy = new ServiceProxy<IService1>())
            {
                var model = proxy.Channel.GetWebManageUsers();
                if (Request.IsAjaxRequest())
                {
                    ViewData["Message"] = "系统为您找了(" + model.Count + ")条符合条件的数据";
                    return PartialView("List.Partial", model);
                }
                return View(model);
            }
        }

        [AuthorizePartial(Role.Student)]
        public ActionResult StudentBanner()
        {
            return View();
        }
    }


}
